import Cookies from 'js-cookie'

/*

* 设置cookies

* */

export function getCookies (key: string) {
  return Cookies.get(key)
}

/*
* 设置Cookies
* @param key
* @param value
* @param expiresTime 过期时间（单位：秒）
*/

export function setCookies (key: string, value: string | object, expiresTime: any) {
  let seconds = expiresTime
  let expires = new Date(new Date() * 1 + seconds * 1000)
  return Cookies.set(key, value, { expires: expires })
}

/*

* 移除Cookies

* */
export function removeCookies (key) {
  return Cookies.remove(key)
}
